import org.junit.jupiter.api.Test;

public class _10_盛最多水的容器 {
    @Test
    void test(){
        int[] arr={1,1};
        System.out.println(maxArea(arr));
    }
    public int maxArea(int[] a) {
        int max = 0;
        for(int i = 0, j = a.length - 1; i < j ; ){
            int minHeight = a[i] < a[j] ? a[i ++] : a[j --];
            max = Math.max(max, (j - i + 1) * minHeight);
        }
        return max;
    }
}
